<script>
// 顶部tab+页面切换
import { defineComponent } from 'vue'
export default defineComponent({
	name: 'WeworkQr'
})
</script>
<script setup>
import { ref } from 'vue'
import { toRaw } from '@vue/reactivity'
import detail from './staff/detail.vue'
import person from './staff/table.vue'
const dialogVisible = ref(false)
const module = ref('person')
const detailMore = ref(null)
const showDetail = (val) => {
	if (val) {
		detailMore.value.show(toRaw(val).id)
	} else {
		detailMore.value.show()
	}
	dialogVisible.value = true
}
const showList = () => {
	console.log('sdfasfdsf')
	dialogVisible.value = false
}
</script>
<template>
	<div>
		<div v-if="!dialogVisible">
			<div class="app-tab app-tab-margin-top">
				<div @click="module = 'person'" :class="module == 'person' ? 'app-tab-item-active' : 'app-tab-item'">
					个人群发
				</div>
				<div @click="module = 'group'" :class="module == 'group' ? 'app-tab-item-active' : 'app-tab-item'">
					个人群群发
				</div>
			</div>
			<person :type="1" v-if="module == 'person'" @showDetail="showDetail" />
			<person :type="2" v-else @showDetail="showDetail" />
		</div>
		<detail ref="detailMore" @goBack="showList" />
	</div>
</template>
<style lang="scss">
@import url('../../../style/app-component.scss');
@import '../../../style/mixin.scss';
.el-page-header {
	display: none;
}
</style>
